<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div class="parent">parent</div>
    <div class="parent">parent</div>
    <style>
      :root {
        --xxx: red;
      }
      body {
        margin: 0;
      }
      .parent {
        width: calc(50% - 2px);
        /* 运算符前后加空格 */
        background-color: var(--xxx, yellow);
        padding: 20px;
        box-sizing: border-box;
        margin: 1px;

        float: left;
      }
    </style>
  </body>
</html>
